using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;

using ILRuntime.CLR.TypeSystem;
using ILRuntime.CLR.Method;
using ILRuntime.Runtime.Enviorment;
using ILRuntime.Runtime.Intepreter;
using ILRuntime.Runtime.Stack;
using ILRuntime.Reflection;
using ILRuntime.CLR.Utils;
using System.Linq;

namespace ILRuntime.Runtime.Generated
{
    unsafe class huqiang_Core_HGUI_HGUIElement_Binding
    {
        public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
        {
            BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
            FieldInfo field;
            Type[] args;
            Type type = typeof(huqiang.Core.HGUI.HGUIElement);

            field = type.GetField("childCount", flag);
            app.RegisterCLRFieldGetter(field, get_childCount_0);
            app.RegisterCLRFieldSetter(field, set_childCount_0);
            app.RegisterCLRFieldBinding(field, CopyToStack_childCount_0, AssignFromStack_childCount_0);
            field = type.GetField("childOffset", flag);
            app.RegisterCLRFieldGetter(field, get_childOffset_1);
            app.RegisterCLRFieldSetter(field, set_childOffset_1);
            app.RegisterCLRFieldBinding(field, CopyToStack_childOffset_1, AssignFromStack_childOffset_1);
            field = type.GetField("parentIndex", flag);
            app.RegisterCLRFieldGetter(field, get_parentIndex_2);
            app.RegisterCLRFieldSetter(field, set_parentIndex_2);
            app.RegisterCLRFieldBinding(field, CopyToStack_parentIndex_2, AssignFromStack_parentIndex_2);
            field = type.GetField("localPosition", flag);
            app.RegisterCLRFieldGetter(field, get_localPosition_3);
            app.RegisterCLRFieldSetter(field, set_localPosition_3);
            app.RegisterCLRFieldBinding(field, CopyToStack_localPosition_3, AssignFromStack_localPosition_3);
            field = type.GetField("localRotation", flag);
            app.RegisterCLRFieldGetter(field, get_localRotation_4);
            app.RegisterCLRFieldSetter(field, set_localRotation_4);
            app.RegisterCLRFieldBinding(field, CopyToStack_localRotation_4, AssignFromStack_localRotation_4);
            field = type.GetField("localScale", flag);
            app.RegisterCLRFieldGetter(field, get_localScale_5);
            app.RegisterCLRFieldSetter(field, set_localScale_5);
            app.RegisterCLRFieldBinding(field, CopyToStack_localScale_5, AssignFromStack_localScale_5);
            field = type.GetField("Position", flag);
            app.RegisterCLRFieldGetter(field, get_Position_6);
            app.RegisterCLRFieldSetter(field, set_Position_6);
            app.RegisterCLRFieldBinding(field, CopyToStack_Position_6, AssignFromStack_Position_6);
            field = type.GetField("Rotation", flag);
            app.RegisterCLRFieldGetter(field, get_Rotation_7);
            app.RegisterCLRFieldSetter(field, set_Rotation_7);
            app.RegisterCLRFieldBinding(field, CopyToStack_Rotation_7, AssignFromStack_Rotation_7);
            field = type.GetField("Scale", flag);
            app.RegisterCLRFieldGetter(field, get_Scale_8);
            app.RegisterCLRFieldSetter(field, set_Scale_8);
            app.RegisterCLRFieldBinding(field, CopyToStack_Scale_8, AssignFromStack_Scale_8);
            field = type.GetField("active", flag);
            app.RegisterCLRFieldGetter(field, get_active_9);
            app.RegisterCLRFieldSetter(field, set_active_9);
            app.RegisterCLRFieldBinding(field, CopyToStack_active_9, AssignFromStack_active_9);
            field = type.GetField("script", flag);
            app.RegisterCLRFieldGetter(field, get_script_10);
            app.RegisterCLRFieldSetter(field, set_script_10);
            app.RegisterCLRFieldBinding(field, CopyToStack_script_10, AssignFromStack_script_10);

            app.RegisterCLRMemberwiseClone(type, PerformMemberwiseClone);

            app.RegisterCLRCreateDefaultInstance(type, () => new huqiang.Core.HGUI.HGUIElement());
            app.RegisterCLRCreateArrayInstance(type, s => new huqiang.Core.HGUI.HGUIElement[s]);


        }

        static void WriteBackInstance(ILRuntime.Runtime.Enviorment.AppDomain __domain, StackObject* ptr_of_this_method, IList<object> __mStack, ref huqiang.Core.HGUI.HGUIElement instance_of_this_method)
        {
            ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
            switch(ptr_of_this_method->ObjectType)
            {
                case ObjectTypes.Object:
                    {
                        __mStack[ptr_of_this_method->Value] = instance_of_this_method;
                    }
                    break;
                case ObjectTypes.FieldReference:
                    {
                        var ___obj = __mStack[ptr_of_this_method->Value];
                        if(___obj is ILTypeInstance)
                        {
                            ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = instance_of_this_method;
                        }
                        else
                        {
                            var t = __domain.GetType(___obj.GetType()) as CLRType;
                            t.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, instance_of_this_method);
                        }
                    }
                    break;
                case ObjectTypes.StaticFieldReference:
                    {
                        var t = __domain.GetType(ptr_of_this_method->Value);
                        if(t is ILType)
                        {
                            ((ILType)t).StaticInstance[ptr_of_this_method->ValueLow] = instance_of_this_method;
                        }
                        else
                        {
                            ((CLRType)t).SetStaticFieldValue(ptr_of_this_method->ValueLow, instance_of_this_method);
                        }
                    }
                    break;
                 case ObjectTypes.ArrayReference:
                    {
                        var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as huqiang.Core.HGUI.HGUIElement[];
                        instance_of_arrayReference[ptr_of_this_method->ValueLow] = instance_of_this_method;
                    }
                    break;
            }
        }


        static object get_childCount_0(ref object o)
        {
            return ((huqiang.Core.HGUI.HGUIElement)o).childCount;
        }

        static StackObject* CopyToStack_childCount_0(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Core.HGUI.HGUIElement)o).childCount;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_childCount_0(ref object o, object v)
        {
            huqiang.Core.HGUI.HGUIElement ins =(huqiang.Core.HGUI.HGUIElement)o;
            ins.childCount = (System.Int32)v;
            o = ins;
        }

        static StackObject* AssignFromStack_childCount_0(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Int32 @childCount = ptr_of_this_method->Value;
            huqiang.Core.HGUI.HGUIElement ins =(huqiang.Core.HGUI.HGUIElement)o;
            ins.childCount = @childCount;
            o = ins;
            return ptr_of_this_method;
        }

        static object get_childOffset_1(ref object o)
        {
            return ((huqiang.Core.HGUI.HGUIElement)o).childOffset;
        }

        static StackObject* CopyToStack_childOffset_1(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Core.HGUI.HGUIElement)o).childOffset;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_childOffset_1(ref object o, object v)
        {
            huqiang.Core.HGUI.HGUIElement ins =(huqiang.Core.HGUI.HGUIElement)o;
            ins.childOffset = (System.Int32)v;
            o = ins;
        }

        static StackObject* AssignFromStack_childOffset_1(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Int32 @childOffset = ptr_of_this_method->Value;
            huqiang.Core.HGUI.HGUIElement ins =(huqiang.Core.HGUI.HGUIElement)o;
            ins.childOffset = @childOffset;
            o = ins;
            return ptr_of_this_method;
        }

        static object get_parentIndex_2(ref object o)
        {
            return ((huqiang.Core.HGUI.HGUIElement)o).parentIndex;
        }

        static StackObject* CopyToStack_parentIndex_2(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Core.HGUI.HGUIElement)o).parentIndex;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_parentIndex_2(ref object o, object v)
        {
            huqiang.Core.HGUI.HGUIElement ins =(huqiang.Core.HGUI.HGUIElement)o;
            ins.parentIndex = (System.Int32)v;
            o = ins;
        }

        static StackObject* AssignFromStack_parentIndex_2(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Int32 @parentIndex = ptr_of_this_method->Value;
            huqiang.Core.HGUI.HGUIElement ins =(huqiang.Core.HGUI.HGUIElement)o;
            ins.parentIndex = @parentIndex;
            o = ins;
            return ptr_of_this_method;
        }

        static object get_localPosition_3(ref object o)
        {
            return ((huqiang.Core.HGUI.HGUIElement)o).localPosition;
        }

        static StackObject* CopyToStack_localPosition_3(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Core.HGUI.HGUIElement)o).localPosition;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_localPosition_3(ref object o, object v)
        {
            huqiang.Core.HGUI.HGUIElement ins =(huqiang.Core.HGUI.HGUIElement)o;
            ins.localPosition = (UnityEngine.Vector3)v;
            o = ins;
        }

        static StackObject* AssignFromStack_localPosition_3(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            UnityEngine.Vector3 @localPosition = (UnityEngine.Vector3)typeof(UnityEngine.Vector3).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)16);
            huqiang.Core.HGUI.HGUIElement ins =(huqiang.Core.HGUI.HGUIElement)o;
            ins.localPosition = @localPosition;
            o = ins;
            return ptr_of_this_method;
        }

        static object get_localRotation_4(ref object o)
        {
            return ((huqiang.Core.HGUI.HGUIElement)o).localRotation;
        }

        static StackObject* CopyToStack_localRotation_4(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Core.HGUI.HGUIElement)o).localRotation;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_localRotation_4(ref object o, object v)
        {
            huqiang.Core.HGUI.HGUIElement ins =(huqiang.Core.HGUI.HGUIElement)o;
            ins.localRotation = (UnityEngine.Quaternion)v;
            o = ins;
        }

        static StackObject* AssignFromStack_localRotation_4(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            UnityEngine.Quaternion @localRotation = (UnityEngine.Quaternion)typeof(UnityEngine.Quaternion).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)16);
            huqiang.Core.HGUI.HGUIElement ins =(huqiang.Core.HGUI.HGUIElement)o;
            ins.localRotation = @localRotation;
            o = ins;
            return ptr_of_this_method;
        }

        static object get_localScale_5(ref object o)
        {
            return ((huqiang.Core.HGUI.HGUIElement)o).localScale;
        }

        static StackObject* CopyToStack_localScale_5(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Core.HGUI.HGUIElement)o).localScale;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_localScale_5(ref object o, object v)
        {
            huqiang.Core.HGUI.HGUIElement ins =(huqiang.Core.HGUI.HGUIElement)o;
            ins.localScale = (UnityEngine.Vector3)v;
            o = ins;
        }

        static StackObject* AssignFromStack_localScale_5(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            UnityEngine.Vector3 @localScale = (UnityEngine.Vector3)typeof(UnityEngine.Vector3).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)16);
            huqiang.Core.HGUI.HGUIElement ins =(huqiang.Core.HGUI.HGUIElement)o;
            ins.localScale = @localScale;
            o = ins;
            return ptr_of_this_method;
        }

        static object get_Position_6(ref object o)
        {
            return ((huqiang.Core.HGUI.HGUIElement)o).Position;
        }

        static StackObject* CopyToStack_Position_6(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Core.HGUI.HGUIElement)o).Position;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_Position_6(ref object o, object v)
        {
            huqiang.Core.HGUI.HGUIElement ins =(huqiang.Core.HGUI.HGUIElement)o;
            ins.Position = (UnityEngine.Vector3)v;
            o = ins;
        }

        static StackObject* AssignFromStack_Position_6(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            UnityEngine.Vector3 @Position = (UnityEngine.Vector3)typeof(UnityEngine.Vector3).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)16);
            huqiang.Core.HGUI.HGUIElement ins =(huqiang.Core.HGUI.HGUIElement)o;
            ins.Position = @Position;
            o = ins;
            return ptr_of_this_method;
        }

        static object get_Rotation_7(ref object o)
        {
            return ((huqiang.Core.HGUI.HGUIElement)o).Rotation;
        }

        static StackObject* CopyToStack_Rotation_7(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Core.HGUI.HGUIElement)o).Rotation;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_Rotation_7(ref object o, object v)
        {
            huqiang.Core.HGUI.HGUIElement ins =(huqiang.Core.HGUI.HGUIElement)o;
            ins.Rotation = (UnityEngine.Quaternion)v;
            o = ins;
        }

        static StackObject* AssignFromStack_Rotation_7(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            UnityEngine.Quaternion @Rotation = (UnityEngine.Quaternion)typeof(UnityEngine.Quaternion).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)16);
            huqiang.Core.HGUI.HGUIElement ins =(huqiang.Core.HGUI.HGUIElement)o;
            ins.Rotation = @Rotation;
            o = ins;
            return ptr_of_this_method;
        }

        static object get_Scale_8(ref object o)
        {
            return ((huqiang.Core.HGUI.HGUIElement)o).Scale;
        }

        static StackObject* CopyToStack_Scale_8(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Core.HGUI.HGUIElement)o).Scale;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_Scale_8(ref object o, object v)
        {
            huqiang.Core.HGUI.HGUIElement ins =(huqiang.Core.HGUI.HGUIElement)o;
            ins.Scale = (UnityEngine.Vector3)v;
            o = ins;
        }

        static StackObject* AssignFromStack_Scale_8(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            UnityEngine.Vector3 @Scale = (UnityEngine.Vector3)typeof(UnityEngine.Vector3).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)16);
            huqiang.Core.HGUI.HGUIElement ins =(huqiang.Core.HGUI.HGUIElement)o;
            ins.Scale = @Scale;
            o = ins;
            return ptr_of_this_method;
        }

        static object get_active_9(ref object o)
        {
            return ((huqiang.Core.HGUI.HGUIElement)o).active;
        }

        static StackObject* CopyToStack_active_9(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Core.HGUI.HGUIElement)o).active;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method ? 1 : 0;
            return __ret + 1;
        }

        static void set_active_9(ref object o, object v)
        {
            huqiang.Core.HGUI.HGUIElement ins =(huqiang.Core.HGUI.HGUIElement)o;
            ins.active = (System.Boolean)v;
            o = ins;
        }

        static StackObject* AssignFromStack_active_9(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Boolean @active = ptr_of_this_method->Value == 1;
            huqiang.Core.HGUI.HGUIElement ins =(huqiang.Core.HGUI.HGUIElement)o;
            ins.active = @active;
            o = ins;
            return ptr_of_this_method;
        }

        static object get_script_10(ref object o)
        {
            return ((huqiang.Core.HGUI.HGUIElement)o).script;
        }

        static StackObject* CopyToStack_script_10(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Core.HGUI.HGUIElement)o).script;
            object obj_result_of_this_method = result_of_this_method;
            if(obj_result_of_this_method is CrossBindingAdaptorType)
            {    
                return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
            }
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_script_10(ref object o, object v)
        {
            huqiang.Core.HGUI.HGUIElement ins =(huqiang.Core.HGUI.HGUIElement)o;
            ins.script = (huqiang.Core.HGUI.UIElement)v;
            o = ins;
        }

        static StackObject* AssignFromStack_script_10(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            huqiang.Core.HGUI.UIElement @script = (huqiang.Core.HGUI.UIElement)typeof(huqiang.Core.HGUI.UIElement).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            huqiang.Core.HGUI.HGUIElement ins =(huqiang.Core.HGUI.HGUIElement)o;
            ins.script = @script;
            o = ins;
            return ptr_of_this_method;
        }


        static object PerformMemberwiseClone(ref object o)
        {
            var ins = new huqiang.Core.HGUI.HGUIElement();
            ins = (huqiang.Core.HGUI.HGUIElement)o;
            return ins;
        }


    }
}
